/*
 * CoreController.h
 *
 *  Created on: Dec 12, 2014
 *      Authors: Avihay Avitan & Stefan Farcas
 */

#ifndef CORECONTROLLER_H_
#define CORECONTROLLER_H_

#include "RequiredIncludes.h"
#include "../CorePassController/CorePassController.h"

namespace CoreSpace {

/**
 * CoreController is the main class of the Pass process.
 * Providing the ability to control and manage the pass process scenario.
 * see [core] section in core.ini file
 */
class CoreController {

	/**
	 * CoreState is an enum class defines the states of the scenario
	 */
enum class CoreState { LOADING_PREDICTION_DATA = 1, INITIATING_ANTENNAS_DIRECTION = 2 , CHECKING_CONDITION = 3, LOADING_UPLINK_CMD = 4, VERIFING_PASS_START = 5 , EXEC_CRITICAL_SECTION = 6 };

public:
	CoreController();
	virtual ~CoreController();

	bool init();
	void run();

private:
	void loadPredictionModule();
	void loadCommandsModule();
	void loadCommunicationModule();
	void loadAntennasControllersModules();

	void logCoreControllerInfo(string function, string content);

	PassPrioritizer * ps;
	PredictionModuleBridge * predictionModule;
	CommandsModuleBridge * commandsModule;
	ICommunicationModuleBridge * connection;
	Logger * logger;
	SatelliteTracker * tracker;

};

} /* namespace CoreSpace */

#endif /* CORECONTROLLER_H_ */
